version: '3.8'
services:
  flask1:
    build: ./app
    networks:
      internal:
        ipv4_address: 172.18.0.3
  flask2:
    build: ./app
    networks:
      internal:
        ipv4_address: 172.18.0.4
  flask3:
    build: ./app
    networks:
      internal:
        ipv4_address: 172.18.0.5
  web:
    build: ./web
    networks:
      bridge:
        ipv4_address: 172.16.0.5
      internal:
        ipv4_address: 172.18.0.2
    ports:
      - 80:80
      - 443:443
networks:
  bridge:
    ipam:
      driver: default
      config:
      -  subnet: 172.16.0.0/24
         gateway: 172.16.0.1
  internal:
    ipam:
      config:
      -  subnet: 172.18.0.0/24
         gateway: 172.18.0.1